package com.jzo2o.customer.controller.operation;


import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 服务人员认证审核表 前端控制器
 * </p>
 *
 * @author wei
 * @since 2025-01-18
 */

@RestController("operationWorkerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "服务端 - 实名接口")
public class WorkerCertificationAuditController {
    @Autowired
    private IWorkerCertificationAuditService workerCertificationAuditService;


    @GetMapping("/page")
    public PageResult<WorkerCertificationAuditResDTO> page (WorkerCertificationAuditPageQueryReqDTO workerCertificationAuditPageQueryReqDTO) {
     return    workerCertificationAuditService.page (workerCertificationAuditPageQueryReqDTO);
    }
    @PutMapping("/audit/{id}")
    public void audit (@PathVariable("id") Long id,
                       @RequestParam("rejectReason") String rejectReason,
                       @RequestParam("certificationStatus") Integer certificationStatus
    ) {
     workerCertificationAuditService.audit (id,rejectReason,certificationStatus);

    }

    @GetMapping("/rejectReason")
    public String rejectReason () {
     return workerCertificationAuditService.rejectReason ();
    }

}
